package com.itheima.controller;

import com.itheima.project.Result;
import com.itheima.project.jobData;
import com.itheima.project.student.ClazzCountOption;
import com.itheima.filter.service.impl.ReportServiceIml;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@Slf4j
@RequestMapping("/report")
@RestController
public class ReportController {
    @Resource
    private ReportServiceIml reportServiceIml;

    @GetMapping("/empJobData")
    public Result countEmp(){
        log.info("统计员工工作和人数");
        jobData jobData = reportServiceIml.countEmp();
        return Result.success(jobData);
    }

    @GetMapping("/empGenderData")
    public Result countGender(){
        log.info("统计员工性别比例");
       List list = reportServiceIml.countGender();
        return Result.success(list);
    }
    @GetMapping("/studentDegreeData")
    public Result studentDegreeCount(){
        log.info("学生学位统计");
        List list = reportServiceIml.studentDegreeCount();
        return Result.success(list);
    }
    @GetMapping("/studentCountData")
    public Result studentCountData(){
        log.info("统计各班总人数");
        ClazzCountOption countOption = reportServiceIml.studentCountData();
        return Result.success(countOption);
    }
}
